var url = serverPre + "/manager/scs/v2/management/channel/list";

var bsConf = {

    queryFormId: "c-query-form",

    createFormId: "c-create-form",

    tableID: "id",

    queryCols: 3,

    queryFloat: "right",

    voName: "c",
    initData: true,
    // needChangeTab: true,
    //
    // needInitECharts: true,

    queryConfigs:                   //页面头部查询form
        [

            {
                type: 'select',
                id :'zh',
                placeholder: '租户',
                label: '租户',
                name: 'companyId',
                idProperty:"companyId",
                verify:"companyId_zh",
                dataUrl:serverPre+"/manager/scs/v2/company",
                nameProperty: 'companyAbbrName'
            },
            {
                type: 'select',
                placeholder: '产品',
                label: '产品',
                id:"cp",
                name: 'code',
                idProperty:"code",
                dataUrl:serverPre+"/manager/scs/v2/product",
                nameProperty: 'productName'
            },
            {
                type: 'datetimerange',
                placeholder: '创建时间',
                label: '创建时间',
                name: 'timeRange',
                default: '',
                verify: ''
            },

        ],

    //列表内容
    tableCols: [
        {field: 'id', title: '序号', type: 'numbers'}
        , {field: 'tenant', width: 300, title: '租户', align: 'center'}
        , {field: 'channelNo', width: 300, title: '产品编码', align: 'center'}
        , {field: 'channelName', width: 200, title: '产品', align: 'center'}
        , {field: 'encryptKey', width: 300, title: '秘钥', align: 'center'}
        , {field: 'createTime', width: 200, title: '创建时间', align: 'center'}
    ],



   /* bindOwnTableEventCol: function (layEvent, data) {
        if (layEvent === 'disable') { //上线
            sealStatus(data['id'],0);
        } else if (layEvent === 'enable') { //下线
            sealStatus(data['id'],1);
        } else if (layEvent === 'view') {//查看统计
            sealInfo(data['id']);
        }
    }*/
}
function query_search() {
    if ($("#up").hasClass("layui-icon-down")) {
        document.getElementById('up').classList.add("layui-icon-up");
        document.getElementById('up').classList.remove("layui-icon-down");
    }else{
        document.getElementById('up').classList.add("layui-icon-down");
        document.getElementById('up').classList.remove("layui-icon-up");

    }
    $("#product-query-form").toggle()
}
/*function sealStatus(a,b) {
    var u = serverPre + "/api/scs/v2/seal/channel/"+a+"/"+b;
    $.ajax({
        type: "GET",
        url: u,
        success: function(data){
            setTimeout('window.location.reload()',500);
        }
    });
}

function query_search() {
    if ($("#up").hasClass("layui-icon-down")) {
        document.getElementById('up').classList.add("layui-icon-up");
        document.getElementById('up').classList.remove("layui-icon-down");
    }else{
        document.getElementById('up').classList.add("layui-icon-down");
        document.getElementById('up').classList.remove("layui-icon-up");

    }
    $("#product-query-form").toggle()
}
function  sealInfo(id) {
    debugger
    var u = serverPre + "/api/scs/v2/seal/channel/sealinfo/"+id;

    var response = $.ajax({
        type: "GET",
        url: u,
        async:false,
        success: function(data){
            debugger;
            //  alert(JSON.stringify(data)
        }
    });

    var json = response.responseJSON;

    if(json.code === 0){
        layer.open({
            type: 1,
            title: '客户产品信息',
            shadeClose: true,
            shade: false,
            maxmin: true,
            content: generateHtml(json.data),
            area: ['50%', '50%'],
            success: function () {

            }
        });
    }else{
        layer.msg("内部错误", {
            icon: 0,
            time: 2000
        });
    }
}

function generateHtml(data){
    return "   <div class=\"layui-row\" style=\"padding-top: 20px\">\n" +
        "            <div class=\"layui-col-xs8\">\n" +
        "                <div class=\"look-form-class\">\n" +
        "                    <form class=\"layui-form\" id=\"preViewForm\">\n" +
        "                        <div class=\"layui-form-item\">\n" +
        "                            <label class=\"layui-form-label\">印章名称</label>\n" +
        "                            <div class=\"layui-input-block\">\n" +
        "                                <input type=\"text\" id=\"sealName\"  value='"+data.sealName+"' readonly=\"readonly\" style=\"width: 300px\" autocomplete=\"off\" placeholder=\"\" class=\"layui-input\">\n" +
        "                            </div>\n" +
        "                        </div>\n" +
        "                        <div class=\"layui-form-item\">\n" +
        "                            <label class=\"layui-form-label\">印模编码</label>\n" +
        "                            <div class=\"layui-input-block\">\n" +
        "                                <input type=\"text\" id=\"sealCode\" value='"+data.sealCode+"'  name=\"sealCode\" lay-verify=\"title\" readonly=\"readonly\" style=\"width: 300px\" autocomplete=\"off\" placeholder=\"\" class=\"layui-input\">\n" +
        "                            </div>\n" +
        "                        </div>\n" +
        "                        <div class=\"layui-form-item\">\n" +
        "                            <label class=\"layui-form-label\">印章密码</label>\n" +
        "                            <div class=\"layui-input-block\">\n" +
        "                                <input type=\"text\" id=\"sealPwd\" value='"+data.sealPwd+"' name=\"sealPwd\" lay-verify=\"title\" readonly=\"readonly\" style=\"width: 300px\" autocomplete=\"off\" placeholder=\"\" class=\"layui-input\">\n" +
        "                            </div>\n" +
        "                        </div>\n" +
        "                        <div class=\"layui-form-item\">\n" +
        "                            <label class=\"layui-form-label\">证件类型</label>\n" +
        "                            <div class=\"layui-input-block\">\n" +
        "                                <input type=\"text\" id=\"identificationTypeName\" value='"+data.identificationTypeName+"' name=\"identificationTypeName\" lay-verify=\"title\" readonly=\"readonly\" style=\"width: 300px\" autocomplete=\"off\" placeholder=\"\" class=\"layui-input\">\n" +
        "                            </div>\n" +
        "                        </div>\n" +
        "                        <div class=\"layui-form-item\">\n" +
        "                            <label class=\"layui-form-label\">证件号码</label>\n" +
        "                            <div class=\"layui-input-block\">\n" +
        "                                <input type=\"text\" name=\"identificationNo\" value='"+data.identificationNo+"' id=\"identificationNo\" readonly=\"readonly\" lay-verify=\"title\" style=\"width: 300px\" autocomplete=\"off\" placeholder=\"\" class=\"layui-input\">\n" +
        "                            </div>\n" +
        "                        </div>\n" +
        "                        <div class=\"layui-form-item\">\n" +
        "                            <label class=\"layui-form-label\">生成时间</label>\n" +
        "                            <div class=\"layui-input-block\">\n" +
        "                                <input type=\"text\" name=\"createTime\" id=\"createTime\"  value='"+data.createTime.substring(0,10)+"' readonly=\"readonly\" lay-verify=\"title\" style=\"width: 300px\" autocomplete=\"off\" placeholder=\"\" class=\"layui-input\">\n" +
        "                            </div>\n" +
        "                        </div>\n" +
        "                        <div class=\"layui-form-item\">\n" +
        "                            <div class=\"layui-input-block\" style=\"padding-top:20px;padding-left: 150px\">\n" +
        "                                <button class=\"layui-btn layui-btn-primary\" id=\"closeWin\">关闭</button>\n" +
        "                            </div>\n" +
        "                        </div>\n" +
        "                    </form>\n" +
        "                </div>\n" +
        "            </div>\n" +
        "            <div class=\"layui-col-xs3\">\n" +
        "                <div class=\"look-image-form-class\">\n" +
        "                        <div style=\"padding-top: 100px;padding-left: 25px\">\n" +
        "                            <img src=\"data:image/jpeg;base64,"+data.image+"\" style=\"width:157px;height:157px\">\n" +
        "                        </div>\n" +
        "                </div>\n" +
        "            </div>\n" +
        "        </div>\n" +
        "    </div>"
}*/

